package team.se.tms.service;

import org.springframework.web.multipart.MultipartFile;
import team.se.tms.dto.CourseMaterialFile;
import team.se.tms.dto.Page;
import team.se.tms.po.CourseMaterialInfo;
import team.se.tms.po.TeachCourse_CourseMaterialInfo;

import java.util.List;

/**
 * 课程资料信息业务层接口,定义了课程资料信息业务层调用的方法
 *
 * @author winkyle
 * @date 2018/11/27
 */
public interface CourseMaterialInfoService {

    /**
     * 获取全部课程资料信息
     *
     * @param page 分页
     * @return 课程资料信息列表
     * @throws Exception 异常
     * @create on 2018/11/27 by winkyle
     */
    List<CourseMaterialFile> listCourseMaterialFiles(Page page) throws Exception;

    /**
     * 根据授课id获取课程资料信息
     *
     * @param teachCourseId 授课id
     * @param page 分页
     * @return 课程资料信息列表
     * @throws Exception 异常
     * @create on 2018/11/27 by winkyle
     */
    List<CourseMaterialFile> listCourseMaterialFiles(String teachCourseId, Page page) throws Exception;

    /**
     * 根据授课id存储课程资料文件，保存课程资料信息
     *
     * @param teachCourseId 授课id
     * @param multipartFile 课程资料文件
     * @return 保存结果
     * @throws Exception 异常
     * @create on 2018/11/27 by winkyle
     */
    Boolean saveCourseMaterial(String teachCourseId, MultipartFile multipartFile) throws Exception;

    /**
     * 根据授课id，课程资料id，是否删除文件删除课程资料文件，删除课程资料信息
     *
     * @param teachCourseId 授课id
     * @param courseMaterialIds 课程资料id
     * @param deleteFile 是否删除文件
     * @return 删除结果
     * @throws Exception 异常
     * @create on 2018/11/27 by winkyle
     */
    Boolean removeCourseMaterials(String teachCourseId, List<String> courseMaterialIds, Boolean deleteFile) throws Exception;

    /**
     * 云端上传
     * @create on 2018/12/28 by argentum
     *
     * @param teachCourseCourseMaterialInfos
     * @return
     * @throws Exception
     */
    Boolean saveTeachCourse_CourseMaterialInfos(List<TeachCourse_CourseMaterialInfo> teachCourseCourseMaterialInfos) throws Exception;

}
